#import <Foundation/Foundation.h>

// NOTE: This is a very simple class that can fetch an xml feed of videos from
// YouTube and parse it into BitlyLink objects. This is meant to be light 
// and simple for learning purposes; a real project should use the full-featured
// GData Objective-C API: http://code.google.com/p/gdata-objectivec-client/
@interface BitlyLink : NSObject {
  NSXMLNode* xmlNode_;
}

// Returns a dictionary keyed by filename-safe video name of the top rated
// videos on YouTube. The vales are BitlyLink*.
+ (NSDictionary *)fetchRecentLinks:(NSString *)user;

+ (id)videoWithXMLNode:(NSXMLNode *)node;
- (id)initWithXMLNode:(NSXMLNode *)node;

// Returns the URL to the thumbnail image for the video.
- (NSURL *)thumbnailURL;

// Returns the URL that will play the video in a web browser.
- (NSURL *)playerURL;

// Returns NSData for the xml string for this video node in pretty-print format.
- (NSData *)xmlData;

@end
